package net.jxvtc.service.appinfo;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import net.jxvtc.dao.appinfo.AppInfoMapper;
import net.jxvtc.pojo.AppInfo;

@Service
public class AppInfoServiceImpl implements AppInfoService {
	   @Resource
	   private AppInfoMapper appInfomapper;
	   
	   
	   
	   
	@Override
	public List<AppInfo> getAppInfo(String querySoftwareName, 
			                     Integer queryStatus, Integer queryFlatfromId,
			                     Integer queryCategoyrLevel, Integer queryCategoyrLeve2, 
			                     Integer queryCategoyrLeve3, Integer queryDevId,
			                     Integer currentPageNo,Integer pageSize) throws Exception
	{
		// TODO Auto-generated method stub
		currentPageNo = (currentPageNo-1)*pageSize;
		return appInfomapper.getAppInfoList(querySoftwareName, queryStatus,
				                            queryFlatfromId,queryCategoyrLevel,
				                            queryCategoyrLeve2,queryCategoyrLeve3,
				                            queryDevId,
				                            currentPageNo, pageSize);
	}

	@Override
	public int getAppInfoCount(String querySoftwareName, Integer queryStatus, 
			                Integer queryFlatfromId,Integer queryCategoyrLevel, 
			                Integer queryCategoyrLeve2, Integer queryCategoyrLeve3, 
			                Integer queryDevId)throws Exception
	{
		// TODO Auto-generated method stub
		return appInfomapper.getAppInfoCount(querySoftwareName, queryStatus,
                                             queryFlatfromId,queryCategoyrLevel,
                                             queryCategoyrLeve2,queryCategoyrLeve3,
                                             queryDevId);
	}

	@Override
	public boolean add(AppInfo appInfo) throws Exception {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(appInfomapper.add(appInfo)>0)
		{
			flag=true;
		}
		return flag;
	}

}
